import request from '@/api/myRequest'
//获取素材列表
function findAllRecommendsApi() {
  return request({
    url: `/lejuAdmin/homeRecommend/findAllRecommends`,
    method: 'GET'
  })
}

//删除素材
function delRecommendApis(recommendId) {
  return request({
    url: `/lejuAdmin/homeRecommend/delRecommend/${recommendId}`,
    method: 'DELETE'
  })
}
//获取广告列表
function adsListApi() {
  return request({
    url: `/lejuAdmin/advertise/adsList`,
    method: 'GET'
  })
}
//删除广告
function delAdsApis(adsId) {
  return request({
    url: `/lejuAdmin/advertise/delAds/${adsId}`,
    method: 'DELETE'
  })
}
//添加广告
function addAdsApis(data) {
  return request({
    url: `/lejuAdmin/advertise/addAds`,
    method: 'POST',
    data
  })
}
//更新广告
function updateAdsApis(data) {
  return request({
    url: `/lejuAdmin/advertise/updateAds`,
    method: 'POST',
    data
  })
}
//分页查询商品列表
function productsByPageApi(start, limit, data) {
  return request({
    url: `/lejuAdmin/product/productsByPage/${start}/${limit}`,
    method: 'POST',
    data
  })
}
//添加限时活动
function addRecommendApi(data) {
  return request({
    url: `/lejuAdmin/homeRecommend/addRecommend`,
    method: 'POST',
    data
  })
}

//修改限时活动
function updateRecommendApi(data) {
  return request({
    url: `/lejuAdmin/homeRecommend/updateRecommend`,
    method: 'POST',
    data
  })
}

export default {
  addRecommendApi,
  updateRecommendApi,
  productsByPageApi,
  updateAdsApis,
  addAdsApis,
  delAdsApis,
  adsListApi,
  findAllRecommendsApi,
  delRecommendApis
}
